-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import/extensions setting #297
Conversation
Actually: could defer the @sindresorhus can you set settings in XO? would that resolve your issue? |
How does the |
It'd just be a normal shared ESLint setting spec'd in an ---
# shown for context. I assume you configure this somewhere
plugins:
- xo
- import
# etc.
# so it would need this too, until the default is set in v2 of import plugin:
settings:
import/extensions: [ .js ] I'm not sure exactly how XO wraps ESLint, so it's not obvious to me where you're setting up plugins. |
@benmosher Ok, I didn't know about that ability. Should work for us as we just supply ESLint with a config file: https://github.com/sindresorhus/xo/blob/cc49ed4ec069bcd0885ac54513bc76b964bcdcd3/config/plugins.js |
Actually, this might be a better place for it: https://github.com/sindresorhus/eslint-config-xo/blob/master/index.js Looks like you're leveraging this for the XO executable, right? or is this just a mirror? Either way, probably ought to be there for consistency (and optimally only there for DRYness). Either way, I'll make the change to have no default for now and open a new issue to default to |
@benmosher That's just an XO implementation detail. I don't put plugin stuff in the pure ESLint config, since you're then forcing the user to manually install each plugin. That's why it's in the XO binary instead, as it can just be dependencies there. But yeah. Sounds good to me. |
Ah, sure, that makes sense. FWIW, the I just prefix mine with |
a849ee7
to
b622e19
Compare
I hope someone can help with this, it is driving me crazy. Atom / Eslint will not recognize my ./src/components/header.js import coding.. Attached is a photo of the sim error and such. I am very new to this and I have tried to fix it by making a new "rule" but I am not sure if I am doing it right. Could someone please help me with this walk through? What rule do I have to add? |
@LycanHalcyon that should be import Header from './src/components/header.js' the syntax error is because you're missing the quotes around the file path. |
Parser whitelist of file extensions. Fixes #267 and obviates a lot of awkward uses for
import/ignore
.Also is a breaking change. I assume a decent chunk of folks are out there using
.jsx
and those references would go silently un-analyzed.I'd like to create a
no-ignored-extensions
rule to go with this, partially as a migration tool. Wouldn't expect folks to keep it on, necessarily, but would flag references to files that were previously being parsed.Tasks:
import/extensions
and fix Don't try to read imported JSON files #267Implementdeferred: Default for import/extensions setting #306no-ignored-extensions
rule